loader.global(function (global) {
    // 全局方法或者变量配置，需要在 index.html 引入 js/global.js
    // 本地调试为空""，会自动转发到app.json配置的域名，正式环境修改为接口域名： http://www.easybui.com/
    let baseurl = "https://ty.happindo.com/prod-api/";
    // let baseurl = "http://127.0.0.1:8333/";
    // let baseurl = "http://47.94.209.247:8333/";
    // 调试使用接口
    let gzhAuthor = baseurl + "web/gzhAuthor";
    let gzhLogin = baseurl + "web/gzhLogin";
    let htmlAuthor = baseurl + "web/htmlAuthor";
    let htmlLogin = baseurl + "web/htmlLogin";
    let getCountryList = baseurl + "web/getCountryList";
    let getMenuList = baseurl + "web/getMenuList";
    let getAdvertiseList = baseurl + "web/getAdvertiseList";
    let getAdvertiseDetailList = baseurl + "web/getAdvertiseDetailList";
    let getAdvertiseInfo = baseurl + "web/getAdvertiseInfo";
    let getAdvertiseInfoOther = baseurl + "web/getAdvertiseInfoOther";
    let getNoticeList = baseurl + "web/getNoticeList";
    let getArticleList = baseurl + "web/getArticleList";
    let getSearchArticleList = baseurl + "web/getSearchArticleList";
    let commentList = baseurl + "web/commentList";
    let register = baseurl + "web/register";
    let getTypeList = baseurl + "web/getTypeList";
    let login = baseurl + "web/login";
    let insertComment = baseurl + "webZh/insertComment";
    let insertArticle = baseurl + "webZh/insertArticle";
    let editArticle = baseurl + "webZh/editArticle";
    let getGzhArticleList = baseurl + "webZh/getArticleList";
    let getCommentList = baseurl + "webZh/getCommentList";
    let getUserList = baseurl + "webZh/getUserList";
    let getUserListByUV = baseurl + "webZh/getUserListByUV";
    let getGzhAdvertiseList = baseurl + "webZh/getAdvertiseList";
    let getZyUserList = baseurl + "webZh/getZyUserList";
    let getFooterInfo = baseurl + "webZh/getFooterInfo";
    let insertFooter = baseurl + "webZh/insertFooter";
    let editFooter = baseurl + "webZh/editFooter";
    let verifyToken = baseurl + "webZh/verifyToken";
    let userPicUpload = baseurl + "web/imageAnalysisUser";
    let imageAnalysisForEditorArticles = baseurl + "web/imageAnalysisForEditorArticles";
    let termTree = baseurl + "webZh/termTree";
    let lyUser = baseurl + "webZh/lyUser";
    let auditArticle = baseurl + "webZh/auditArticle";
    let getComment = baseurl + "web/getComment";
    let auditComment = baseurl + "web/auditComment";
    let htmlAuthorBind = baseurl + "web/htmlAuthorBind";
    let gzhAuthorBind = baseurl + "web/gzhAuthorBind";
    let selectUserVisit = baseurl + "web/selectUserVisit";
    let clearUserVisit = baseurl + "web/clearUserVisit";
    let termTypeTree = baseurl + "web/termTypeTree";
    let deleteArticle = baseurl + "web/deleteArticle";
    let hfArticle = baseurl + "web/hfArticle";
    let deleteArticle2 = baseurl + "web/deleteArticle2";
    let cancelPcArticle = baseurl + "web/cancelPcArticle";
    let deleteComment = baseurl + "web/deleteComment";
    let deleteUser = baseurl + "web/deleteUser";
    let sqQx = baseurl + "web/sqQx";
    let deleteAdvertise = baseurl + "web/deleteAdvertise";
    let advertisePicUpload = baseurl + "web/imageAnalysisAdvertise";
    let pzPicUpload = baseurl + "web/imageAnalysisPz";
    let getAdvertiseInfoByEdit = baseurl + "web/getAdvertiseInfoByEdit";
    let insertAdvertise = baseurl + "web/insertAdvertise";
    let editAdvertise = baseurl + "web/editAdvertise";
    let getWxConfig = baseurl + "web/getWxConfig";
    let getEditorConfig = baseurl + "web/getEditorConfig";
    let getAdvertiseInfoLook = baseurl + "web/getAdvertiseInfoLook";
    let alterQrcode = baseurl + "web/alterQrcode";
    let alterUserPwd = baseurl + "web/alterUserPwd";
    let alterUserEmail = baseurl + "web/alterUserEmail";
    let imageAnalysisArticle = baseurl + "web/imageAnalysisArticle";
    let getCityById = baseurl + "web/getCityById";
    let getCityByLocal = baseurl + "web/getCityByLocal";
    let getZhList = baseurl + "web/getZhList";
    let createQrcode = baseurl + "web/createQrcode";
    let getCountryTermList = baseurl + "web/getCountryTermList";
    let imageAnalysisForUEditorArticle = baseurl + "web/imageAnalysisForUEditorArticle";
    let getTypeMenuList = baseurl + "web/getTypeMenuList";

    const { translate, start } = require('./translate')
    return {
        translate: translate,
        api: {
            getTypeMenuList:getTypeMenuList,
            imageAnalysisForUEditorArticle:imageAnalysisForUEditorArticle,
            pzPicUpload: pzPicUpload,
            baseurl: baseurl,
            register: register,
            alterUserEmail: alterUserEmail,
            getEditorConfig: getEditorConfig,
            userPicUpload: userPicUpload,
            insertFooter: insertFooter,
            editFooter: editFooter,
            gzhAuthor: gzhAuthor,
            gzhLogin: gzhLogin,
            htmlAuthor: htmlAuthor,
            htmlLogin: htmlLogin,
            getCountryList: getCountryList,
            getAdvertiseList: getAdvertiseList,
            getAdvertiseInfo: getAdvertiseInfo,
            getNoticeList: getNoticeList,
            getArticleList: getArticleList,
            getSearchArticleList: getSearchArticleList,
            getAdvertiseDetailList: getAdvertiseDetailList,
            commentList: commentList,
            getTypeList: getTypeList,
            login: login,
            insertComment: insertComment,
            termTree: termTree,
            insertArticle: insertArticle,
            auditArticle: auditArticle,
            getComment: getComment,
            auditComment: auditComment,
            gzhAuthorBind: gzhAuthorBind,
            htmlAuthorBind: htmlAuthorBind,
            selectUserVisit: selectUserVisit,
            clearUserVisit: clearUserVisit,
            termTypeTree: termTypeTree,
            editArticle: editArticle,
            getGzhArticleList: getGzhArticleList,
            deleteArticle: deleteArticle,
            deleteArticle2: deleteArticle2,
            cancelPcArticle: cancelPcArticle,
            getCommentList: getCommentList,
            deleteComment: deleteComment,
            getUserList: getUserList,
            getUserListByUV: getUserListByUV,
            deleteUser: deleteUser,
            sqQx: sqQx,
            getGzhAdvertiseList: getGzhAdvertiseList,
            deleteAdvertise: deleteAdvertise,
            advertisePicUpload: advertisePicUpload,
            getAdvertiseInfoByEdit: getAdvertiseInfoByEdit,
            getZyUserList: getZyUserList,
            getFooterInfo: getFooterInfo,
            editAdvertise: editAdvertise,
            insertAdvertise: insertAdvertise,
            getWxConfig: getWxConfig,
            verifyToken: verifyToken,
            getAdvertiseInfoLook: getAdvertiseInfoLook,
            alterQrcode: alterQrcode,
            alterUserPwd: alterUserPwd,
            imageAnalysisForEditorArticles: imageAnalysisForEditorArticles,
            getMenuList: getMenuList,
            imageAnalysisArticle: imageAnalysisArticle,
            getCityById: getCityById,
            getCityByLocal: getCityByLocal,
            hfArticle: hfArticle,
            getZhList: getZhList,
            lyUser: lyUser,
            getAdvertiseInfoOther: getAdvertiseInfoOther,
            createQrcode: createQrcode,
            getCountryTermList: getCountryTermList
        },
        path: "",
        ajax: function (opt) {
            /**
             * 全局的请求方法
             * 使用示例：
             * global.ajax({url:"",data:{}}).then(function(res){
                console.log(res)
                })
             */
            let props = $.extend(true, { headers: {} }, opt);
            return bui.ajax(props);
        },
        hint: function (text) {
            /**
             * 全局的提示
             * 使用示例：
             * global.hint("提示信息")
             */
            let props = $.extend(true, { position: "bottom" }, { content: text });
            return bui.hint(props);
        }
    }
})
